Skip to content

Use multi value remixers, composers, lyricists and arrangers#6487

Open
snejus wants to merge 15 commits intomasterfrom
use-multi-value-remixers
Open

Use multi value remixers, composers, lyricists and arrangers#6487
snejus wants to merge 15 commits intomasterfrom
use-multi-value-remixers

Conversation

@snejus
Copy link
Copy Markdown
Member

@snejus snejus commented Apr 2, 2026

Migrate artist-credit fields to multi-value lists

This converts remixer, lyricist, composer, and arranger into proper multi-value fields: remixers, lyricists, composers, and arrangers.

What changed

  • Data model (beets/library/models.py): replaces the legacy single-string remixer, lyricist, composer, and arranger fields with multi-value list fields.
  • Migrations (beets/library/migrations.py, beets/library/library.py): extracts a reusable MultiValueFieldMigration base class and adds field-specific migrations for remixers, lyricists, composers, and arrangers.
  • Metadata compatibility (beets/autotag/hooks.py): centralizes legacy singular-to-plural compatibility in Info / TrackInfo, so old assignments like info.remixer = "..." still work and populate the new list fields.
  • MusicBrainz (beetsplug/musicbrainz.py): now preserves these credits as lists instead of comma-joined strings.
  • Follow-up updates: adjusts tests, docs, and related field mappings (aura, bpd) to use the plural multi-value fields, and bumps the minimum mediafile version to 0.16.0.

Impact

  • Existing libraries are migrated automatically on first run.
  • Older code assigning singular string fields continues to work via the compatibility shim, but emits DeprecationWarnings.
  • These metadata fields now behave consistently with other multi-value fields like genres.

@snejus snejus requested a review from a team as a code owner April 2, 2026 10:14
Copilot AI review requested due to automatic review settings April 2, 2026 10:14
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 2, 2026

Thank you for the PR! The changelog has not been updated, so here is a friendly reminder to check if you need to add an entry.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.10%. Comparing base (131768b) to head (392962e).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6487      +/-   ##
==========================================
+ Coverage   70.06%   70.10%   +0.04%     
==========================================
  Files         147      147              
  Lines       18562    18588      +26     
  Branches     3026     3027       +1     
==========================================
+ Hits        13005    13032      +27     
  Misses       4924     4924              
+ Partials      633      632       -1     
Files with missing lines Coverage Δ
beets/autotag/hooks.py 98.85% <100.00%> (+0.43%) ⬆️
beets/dbcore/types.py 96.58% <100.00%> (ø)
beets/library/library.py 93.65% <ø> (ø)
beets/library/migrations.py 95.91% <100.00%> (+0.85%) ⬆️
beets/library/models.py 87.06% <ø> (ø)
beetsplug/aura.py 57.35% <ø> (ø)
beetsplug/bpd/__init__.py 24.34% <ø> (ø)
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

grug see PR move legacy single-string remixer over to multi-value remixers, like earlier genre -> genres move. grug see this touch library model, db migration, autotag info shim, and MusicBrainz extract, plus tests.

Changes:

  • change item model field from remixer to multi-value remixers
  • add reusable MultiValueFieldMigration and new MultiRemixerFieldMigration backfill
  • add Info / TrackInfo __setitem__ shim to accept legacy genre / remixer string sets and map into list fields

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
beets/library/models.py swap fixed field to remixers multi-value
beets/library/migrations.py extract generic multi-value backfill migration + add remixer migration
beets/library/library.py register new migration in library boot path
beets/autotag/hooks.py add legacy setter shims for genre/remixer to list fields
beetsplug/musicbrainz.py emit remixers as list, adjust merge fields to genres
beets/dbcore/types.py tweak multi-value normalize to use model_type()
test/autotag/test_hooks.py add tests for legacy string->list helper + update apply fixtures
test/library/test_migrations.py add migration test for remixer->remixers backfill
test/plugins/test_musicbrainz.py update remixer assertion to remixers list

@snejus snejus force-pushed the use-multi-value-remixers branch from f089fae to b68d61e Compare April 2, 2026 13:52
@snejus snejus requested a review from Copilot April 2, 2026 13:52
@snejus snejus force-pushed the use-multi-value-remixers branch from b68d61e to 75a76dd Compare April 2, 2026 13:57
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 14 out of 15 changed files in this pull request and generated 1 comment.

@snejus snejus force-pushed the use-multi-value-remixers branch from 75a76dd to c40b990 Compare April 2, 2026 14:23
@snejus snejus requested a review from Copilot April 2, 2026 14:23
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 14 out of 15 changed files in this pull request and generated 2 comments.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 14 out of 15 changed files in this pull request and generated 1 comment.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 14 out of 15 changed files in this pull request and generated 2 comments.

@snejus snejus force-pushed the use-multi-value-remixers branch 2 times, most recently from 5d7af33 to 60d7855 Compare April 3, 2026 01:18
@snejus snejus changed the title Use multi value remixers Use multi value remixers, composers, lyricists and arrangers Apr 3, 2026
@snejus snejus force-pushed the use-multi-value-remixers branch 2 times, most recently from a0f6a09 to 22557ad Compare April 3, 2026 08:22
@snejus snejus force-pushed the use-multi-value-remixers branch 2 times, most recently from 85969e8 to c77ea75 Compare April 3, 2026 17:56
snejus added a commit to beetbox/mediafile that referenced this pull request Apr 3, 2026
## Add `lyricists`, `composers` and `arrangers` List Fields

Converts the `lyricist` and `composer` scalar fields into
`ListMediaField`-backed plural fields (`lyricists` and `composers`),
following the same pattern used by `artists`,
`albumartists`, `genres`, and `remixers`. The singular `lyricist` and
`composer` fields are preserved as first-value convenience aliases via
`.single_field()`.

### Changes

- **`mediafile/__init__.py`**: Replaces `lyricist = MediaField(...)`
with `lyricists = ListMediaField(...)` and `composer = MediaField(...)`
with `composers =
ListMediaField(...)`, using list-aware storage styles
(`MP3ListStorageStyle`, `MP4ListStorageStyle`, `ListStorageStyle`)
across all supported formats. `lyricist` and `composer`
are retained as `lyricists.single_field()` and
`composers.single_field()`.
- **Tests**: Adds `LyricistListTestMixin` and `ComposerListTestMixin`
with round-trip tests for list writes and first-value access.
WMA-specific overrides handle the format's
non-deterministic list ordering. `lyricists` and `composers` are added
to the known-fields assertion.
- **Docs/README**: Updates field enumeration examples and changelog
entries to include `lyricists` and `composers` in the list of plural
fields.

These adjustments have been tested locally in combination with
beetbox/beets#6487

See these tags on my Navidrome instance

**Before**
All artists are joined with a comma so Navidrome treats the entire
combination as a single artist
<img width="477" height="202" alt="image"
src="https://github.com/user-attachments/assets/66692eb0-4f0c-43cb-816a-9a8a8995c920"
/>

**After**
Each artist is separate
<img width="477" height="198" alt="image"
src="https://github.com/user-attachments/assets/e986a3e8-2bc6-4392-af32-d2b0b2a5819f"
/>
@snejus snejus force-pushed the use-multi-value-remixers branch from c77ea75 to a95fea1 Compare April 3, 2026 18:13
@snejus snejus requested a review from Copilot April 3, 2026 21:23
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 18 out of 19 changed files in this pull request and generated 2 comments.

@snejus snejus force-pushed the use-multi-value-remixers branch from a95fea1 to 753c398 Compare April 3, 2026 21:59
@snejus snejus force-pushed the use-multi-value-remixers branch from 753c398 to 809cbca Compare April 3, 2026 22:05
@JOJ0 JOJ0 added the core Pull requests that modify the beets core `beets` label Apr 4, 2026
Copy link
Copy Markdown
Member

@JOJ0 JOJ0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly LGTM, except my bikeshedding of variable names (which I do find quite important though). I'm AFK for the rest of the day but might be able to look again tonight.

@snejus snejus force-pushed the use-multi-value-remixers branch from 809cbca to 392962e Compare April 4, 2026 12:27
@snejus snejus requested a review from JOJ0 April 4, 2026 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Pull requests that modify the beets core `beets`

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants